x86/emul: Correct the return value handling of VMFUNC
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 18 Jan 2017 08:51:53 +0000 (09:51 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 18 Jan 2017 08:51:53 +0000 (09:51 +0100)
commita6542288d3a3803dfe683c62e7692b7dcd679402
tree67188997c9325da5da8a97c5664736af8ca53af0
parentc581eadec6cdaebb139993390bb9d1e22b2f77d9
x86/emul: Correct the return value handling of VMFUNC

The bracketing of x86_emulate() calling the ops->vmfunc() hook is wrong with
respect to the assignment to rc, which can trip the new assertions in
x86_emulate_wrapper().

The hvmemul_vmfunc() hook should only raise #UD if X86EMUL_EXCEPTION is
returned.  This is only a latent bug at the moment.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 3ab1876504d409689824e161a8b04e57e1e5dd46
master date: 2016-12-22 13:32:46 +0000
xen/arch/x86/hvm/emulate.c
xen/arch/x86/x86_emulate/x86_emulate.c